package gui;



import javax.swing.JFrame;
import javax.swing.JTabbedPane;


public class Visualizer extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//-------------------------------------------------------- class var
	private JTabbedPane tabbed;
	
	//-------------------------------------------------------- constructor
	public Visualizer(String string) {
		super(string);
		
		tabbed = new JTabbedPane();
	}
	
	//-------------------------------------------------------- add and remove tabs
	//-------------------------------------------------------- publics
	public int addTab(JTitledPanel component) {
		tabbed.addTab(component.title, component);
		tabbed.setSize(this.getSize());
		add(tabbed);
		return tabbed.indexOfTabComponent(component);
	}
	public JTitledPanel removeTab(int index) {
		JTitledPanel component = (JTitledPanel)tabbed.getComponentAt(index);
		tabbed.removeTabAt(index);
		return component;
	}
	public int indexOf(JTitledPanel component) {
		return tabbed.indexOfComponent(component);
	}


}

